import { createI18n } from 'vue-i18n'
import zhCN from '@/lang/zh-CN'
import enUS from '@/lang/en-US'

const messages = {
    'zh-CN': zhCN,
    'en-US': enUS
}

const savedLocale = localStorage.getItem('locale') || 'zh-CN'

const i18n = createI18n({
    legacy: false,
    locale: savedLocale,
    fallbackLocale: 'zh-CN',
    messages
})

export { i18n }